data = [10, 1, 5, 14, 7, 19, 24, 2,3,4,15,12,45,67,13,42,26]
data.sort()

start_index=0
end_index=1
max_len = 0
while end_index != len(data):
    tmp = data[start_index:end_index]
    if max(tmp) - min(tmp) < 10:
        end_index += 1
        max_len = max(max_len,len(tmp))
    else:
        start_index += 1

print(max_len)